<template>
	<view class="container_main safe-area-inset-bottom">
		<video-swiper :dataList="dataList" @loadMore="loadDataList"></video-swiper>
	</view>
</template>

<script>
import videoSwiper from '../video-swiper/index.vue';
import { pageShare } from '../../mixins/pageShare';
import { pagingMixin } from '@/mixins/pagingMixin.js';
export default {
	mixins: [pagingMixin, pageShare],
	components: {
		'video-swiper': videoSwiper
	},
	data() {
		return {};
	},
	mounted() {
		this.$initPage();
	},
	methods: {
		$initPage() {
			this._init_data('GetInfotainmentList', { type: 2 }, { reset:true,callBack: this.$formatList });
		},
		loadDataList() {
			this._load_data({reset:true, callBack: this.$formatList });
		},
		$formatList(data) {
			let arr = data.filter(item => {
				return item.voide ? true : false;
			});
			return arr.map(item => {
				return {
					...item,
					share:parseInt(Math.random() * (item.view/2) + (item.view/10)),
					url: item.voide
				};
			});
		},
		$onShow() {
			this.shareOnshow()
		},
	}
};
</script>
<style scoped lang="scss">
.container_main {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 100%;
}
</style>
